﻿/*-----------------------------------------------------------------------------------
  
  Component : DataManagement
  
  Source file : VerifyScp.cs
  
  Author : HungNguyen 
  
  Creation Date : 12/26/2011 
  
  Description : this class is used to storage verifyScp object information for Dicom Server.
  
  Use Case : this class is used in Dicom Communicator Use case
  
  Includes : ClearCanvas.Dicom project 
  
  Notes : <Optional/additional comments regarding the source file> - Optional 
  
  Copyright Prowess, Inc. 2011 
  
  The copyright to the computer program(s) herein is the property of Prowess, Inc. 
  The program(s) may be used and/or copied only with the written permission of Prowess, Inc. 
  or in accordance with the terms and conditions stipulated in the agreement/contract under 
  which the program(s) have been supplied. 
 -----------------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClearCanvas.Dicom.Network;
using ClearCanvas.Dicom;

namespace Prowess.Lynx.DicomCommunicator
{
    public class VerifyScp:ScpObject
    {
        public VerifyScp()
            : base(GetSupportedSops())
        {

        }
        /// <summary>
        /// Get Sop supported for Dicom Network
        /// </summary>
        /// <returns></returns>
        private static IEnumerable<SupportedSop> GetSupportedSops()
        {
            SupportedSop sop = new SupportedSop();
            sop.SopClass = SopClass.VerificationSopClass;
            sop.SyntaxList.Add(TransferSyntax.ExplicitVrLittleEndian);
            sop.SyntaxList.Add(TransferSyntax.ImplicitVrLittleEndian);
            yield return sop;
        }        
        public override bool OnReceiveRequest(DicomServer server, ServerAssociationParameters association, byte presentationID, DicomMessage message)
        {
            server.SendCEchoResponse(presentationID, message.MessageId, DicomStatuses.Success);
            return true;
        }
    }
}
